﻿<Window x:Class="InChatter.Client.WPFClient.View.MessagePoolWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:rex="clr-namespace:InChatter.Localization.Properties;assembly=InChatter.Localization"
        Title="MessagePoolWindow" Height="300" Width="500" AllowsTransparency="True"  Background="Transparent" Topmost="True" ShowInTaskbar="False" WindowStyle="None">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/InChatter.Client.WPFClient;component/Style/DefaultStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Border Name="Brd" CornerRadius="3" 
                BorderBrush="#FF828790" Background="White"
                BorderThickness="1"
                Grid.Row="0">
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="*" />
                <RowDefinition Height="35" />
            </Grid.RowDefinitions>
            <TextBlock Text="{x:Static rex:Resources.MessageAlert}" Grid.Row="0" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <Button Grid.Row="0" 
                        Margin="10,5"
                        HorizontalAlignment="Right" 
                        VerticalAlignment="Center" 
                        Content="×"
                        FontSize="9"
                        Command="{Binding ExcuteCloseMessage}"/>
            <ListBox Grid.Row="1" ItemsSource="{Binding Path=Messages}" Margin="10,0">
                <ListBox.ItemTemplate>
                    <DataTemplate >
                        <TextBlock Margin="0,5" Width="450" TextTrimming="CharacterEllipsis">
                              <Hyperlink ToolTip="{Binding Path=Content}" TextDecorations="None"
                                         Command="{Binding Path=DataContext.ExcuteLinkOrIgnoreMesssge,RelativeSource={RelativeSource AncestorType=Window}}"
                                         CommandParameter="{Binding}">
                                  <Grid>
                                      <Grid.ColumnDefinitions>
                                          <ColumnDefinition Width="Auto"></ColumnDefinition>
                                          <ColumnDefinition Width="*"></ColumnDefinition>
                                      </Grid.ColumnDefinitions>
                                      <Grid.RowDefinitions>
                                          <RowDefinition></RowDefinition>
                                          <RowDefinition></RowDefinition>
                                      </Grid.RowDefinitions>
                                     <TextBlock FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0" Grid.Column="0" Grid.Row="0" Text="{Binding SenderName}" />
                                     <TextBlock FontSize="12" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding Path=SendTime}"/>
                                     <TextBlock Grid.ColumnSpan="2" Margin="5" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Path=Content}"/> 
                                  </Grid>
                              </Hyperlink>
                        </TextBlock>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right">
                <Button Margin="0,0,10,0" Height="25" Width="70" Content="{x:Static rex:Resources.IgnoreButton}"
                            Command="{Binding Path=ExcuteLinkOrIgnoreMesssge}"
                                         CommandParameter="{Binding MessageInfos}"/>
            </StackPanel>
        </Grid>
    </Border>
</Window>
